package com.lg.partition14;

import java.io.*;
import java.util.Arrays;

/**
 * @author `RKC`
 * @date 2022/4/22 12:13
 */
public class P1330封锁阳光大学 {

    private static final int N = 10010, M = 200010;
    private static int[] h = new int[N], e = new int[M], ne = new int[M], color = new int[N];
    private static int n, m, idx = 0, cnt1 = 0, cnt2 = 0;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = nextInt();
        m = nextInt();
        Arrays.fill(h, -1);
        for (int i = 0; i < m; i++) {
            int a = nextInt(), b = nextInt();
            add(a, b);
            add(b, a);
        }
        boolean flag = false;
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            if (color[i] == 0 && !dfs(i, 1)) {
                flag = true;
                break;
            }
            ans += Math.min(cnt1, cnt2);
            cnt1 = cnt2 = 0;
        }
        if (flag) writer.println("Impossible");
        else writer.println(ans);
        writer.flush();
    }

    private static boolean dfs(int u, int col) {
        color[u] = col;
        if (col == 1) cnt1++;
        else cnt2++;
        for (int i = h[u]; i != -1; i = ne[i]) {
            int v = e[i];
            if (color[v] == color[u]) return false;
            if (color[v] == 0 && !dfs(v, 3 - col)) return false;
        }
        return true;
    }

    private static void add(int a, int b) {
        e[idx] = b;
        ne[idx] = h[a];
        h[a] = idx++;
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
